function $(id){
	return document.getElementById(id);
}

var count = 0;
var maxCount = 3;
var imglist = document.getElementsByName("myImg");
var liList = document.getElementsByName("myLi");
liList[0].style.backgroundColor="red";
var isStart=true;
function show(){
	if(isStart){
		for(var i=0;i<imglist.length;i++){
			imglist[i].style.display="none";
			liList[i].style.backgroundColor="";
		}
		count++;
		if(count>maxCount){
			count=0;
		}
		imglist[count].style.display="block";
		liList[count].style.backgroundColor="red"
	}
}
function myshow(n){
	isStart=false;
	for(var i=0;i<imglist.length;i++){
		imglist[i].style.display="none";
		liList[i].style.backgroundColor="";
	}
	imglist[n-1].style.display="block";
	liList[n-1].style.backgroundColor="red";
	count=n-1;
}

function outStart(){
	isStart=true;
}

setInterval("show()",3000);